<?php

	class RemoveObjectCommand implements ICommand
	{
		public function execute($event)
		{
			$type = (int) $event->data['type'];
			$id = (int) $event->data['id'];
						
			if (is_numeric($id))
			{
				if ($type === 1)
				{
					$model = EbModel::getModel('VarPeople','Boutique');
					
					$model->delete($id);
					
					return new Event('redirect','/admin-boutique');
				}
				else if ($type === 2)
				{
					$model = EbModel::getModel('VarPeople','Categorie');
					
					$model->delete($id);
					
					return new Event('redirect','/admin-categorie');
				}
				else if ($type === 3)
				{
					$model = EbModel::getModel('VarPeople','Reportage');
					
					$model->delete($id);
					
					return new Event('redirect','/admin-reportage');
				}				
			}
			
			//return new Event('redirect','/login');
		}
	}